<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Document</title>
    <link rel="stylesheet" href="../../css/api.css">
	   <link rel="stylesheet" href="../../css/aui_font.css">
	   <link rel="stylesheet" href="../../css/base_icon.css">
	<style>
		body{
			    background-color: #F9FAFE;
		}
		#view{
			
			padding: 20px;
		}
		
		.card{
			
			padding: 50px 10px;
			display: flex;
			align-items: center;
			font-size: 30px;
		}
		
		.box{
			padding: 10px 0;
		}
		.box .title{
			font-weight: bold;
		}
		.box .list{
			display: flex;
			align-items: center;
			flex-wrap: wrap;
		}
		.box .list .item{
			width: calc(50% - 20px);
			margin-left: 10px;
			margin-right: 10px;
			margin-top: 10px;
			background-color: #FFFFFF;
			display: flex;
			flex-direction: column;
			align-items: center;
			padding: 20px 0;
		}
		.box .list .da{
			padding: 10px;
			font-size: 24px;
			font-weight: bold;
			color: #6749F9;
		}
		.box .list .dt{
			font-size: 14px;
		}
		.link-box{
			margin-top: 10px;
			background-color: #EBE8FD;
			padding: 10px;
			border-radius: 10px;
			display: flex;
			align-items: center;
		}
		.link{
			flex: 1;
			word-break: break-all
		}
		
	</style>
</head>

<body>
   <div id="view">
		<div class="card">
			{{_i18n('可生成链接,用于不同渠道推广并监控流量数据')}}
		</div>
		<div class="box">
			<div class="title">{{_i18n('推广链接')}}</div>
			<div class="list">
				<div class="item">
					<div class="da">{{info.reg_yesterday}}</div>
					<div class="dt">{{_i18n('昨日注册用户')}}</div>
				</div>
				<div class="item">
					<div class="da">{{info.reg_total}}</div>
					<div class="dt">{{_i18n('总注册用户')}}</div>
				</div>
				<div class="item">
					<div class="da">{{info.link_yesterday}}</div>
					<div class="dt">{{_i18n('昨日链接点击次数')}}</div>
				</div>
				<div class="item">
					<div class="da">{{info.link_total}}</div>
					<div class="dt">{{_i18n('链接点击次数')}}</div>
				</div>
			</div>
		</div>
		<div class="link-box">
			<div class="link" @click="copyTxt()">
				{{_i18n('链接')}}:<br/>
				{{info.url}}
			</div>
			<img src="../../image/icon/copy.png" width="16" alt="">
		</div>
   </div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/ffkj.js"></script>
<script src="../../script/vue.js"></script>
<script>
    var view = new Vue({
        el: '#view',
		data:{
			info: {
				"reg_yesterday": 0,
				"reg_total": 0,
				"link_total": 0,
				"link_yesterday": 0,
				"url": ""
			}
		},
		methods: {
			copyTxt() {
				copyTxt(this.info.url)
			}
		},
	})
     apiready = function() {
		 getInfo()
	  }
	  function getInfo() {
	      _ajax('api/proxy/link', function(ret, err) {
	          if (ret && ret.data && ret.data) {
				  view.info = ret.data
	          } 
	      },  {
			user_id: $api.getStorage('userid')
		})
	  }
	  

</script>

</html>